package com.example.demo;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisShardInfo;

public class test {

    public void connect() {
        JedisShardInfo shardInfo = new JedisShardInfo("redis://39.107.69.252:6379");//这里是连接的本地地址和端口
        shardInfo.setPassword("Cy.87669252");//这里是密码
        Jedis jedis = new Jedis(shardInfo);
        System.out.println(jedis.get("hello"));
    }

    public static void main(String[] args) {
        test t = new test();
        t.connect();
    }
}
